package com.jk.dao;

import com.jk.pojo.BookEntity;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface BookDao {


    int findCount(@Param("book") BookEntity book);

    List<BookEntity> find(@Param("start")int start, @Param("book")BookEntity book);

    @Insert("insert into t_book (bookName,bookPrice,bookType) values (#{bookName},#{bookPrice},#{bookType})")
    void add(BookEntity book);

    @Update("update t_book set bookName = #{bookName},bookPrice = #{bookPrice},bookType = #{bookType} where bookId = #{bookId}")
    void update(BookEntity book);

    @Delete("delete from t_book where bookId = #{id}")
    void del(Integer id);

    @Select("select * from t_book where bookId = #{id}")
    BookEntity findById(Integer id);
}
